package router

import (
	"k8s-admin/controller/kubernetes"
	"k8s-admin/middleware"

	"github.com/gin-gonic/gin"
)

func ConfigMao_Secret(r *gin.Engine) {
	configmap := r.Group("configmap/:cid")
	configmap.Use(middleware.K8sCache(), middleware.ChecKToken(), middleware.CasbinMiddle())
	{
		configmap.POST("createClusterConfigMap", kubernetes.CreateClusterConfigMap)
		configmap.GET("getClusterConfigMapList", kubernetes.GetClusterConfigMapList)
		configmap.GET("getClusterConfigMap", kubernetes.GetClusterConfigMapInfo)
		configmap.DELETE("deleteClusterConfigMap", kubernetes.DeleteClusterConfigMap)
		configmap.PUT("updateClusterConfigMap", kubernetes.UpdateClusterConfigMap)
	}
	secret := r.Group("secret/:cid")
	secret.Use(middleware.K8sCache(), middleware.ChecKToken(), middleware.CasbinMiddle())
	{
		secret.POST("createClusterSecret", kubernetes.CreateClusterSecret)
		secret.GET("getClusterSecretList", kubernetes.GetClusterSecretList)
		secret.GET("getClusterSecret", kubernetes.GetClusterSecretInfo)
		secret.DELETE("deleteClusterSecret", kubernetes.DeleteClusterSecret)
		secret.PUT("updateClusterSecret", kubernetes.UpdateClusterSecret)
	}
}
